package com.jingdianjichi.auth.common.enums;

import lombok.Getter;

/**
 * 用户状态枚举
 * @author 86156
 * @version 1.0
 * @date 2024-10-31 10:38
 */
@Getter
public enum AuthUserStatusEnum {

    OPEN(0,"启用"),
    CLOSE(1,"禁用");

    private Integer code;
    private String desc;

    AuthUserStatusEnum(Integer code,String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static AuthUserStatusEnum getByCode(int codeVal){
        for (AuthUserStatusEnum anEnum : AuthUserStatusEnum.values()) {
            if(anEnum.code == codeVal){
                return anEnum;
            }
        }
        return null;
    }

}
